package j03zuoye;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Z1 {
    public static void main(String[] args) {
        List<Ticket> list = new ArrayList<>();
        Collections.addAll(
                list,
                new Ticket(" Z286", "11:05", 358, 185),
                new Ticket("G802", "17:11", 139, 368),
                new Ticket("G554", "09:22", 206, 350),
                new Ticket("G80", "13:10", 140, 368),
                new Ticket("G402", "20:41", 181, 355)
        );
        for (Ticket temp :list) {
            System.out.println(temp);
        }
        //排序
        Collections.sort(list,(t1,t2)->t1.getStartTime().compareTo(t2.getStartTime()));
        System.out.println(list);
        Collections.sort(list,(t1,t2)->t1.getDuration()-t2.getDuration());
        System.out.println(list);
    }
}
